package phoenix.core.helpers.extensions;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import phoenix.core.PhoenixManager;
import core.ApplicationManager;
import core.helpers.StringHelper;

public class StringHelperExt extends StringHelper
{
	// PhoenixManager instance
	protected static PhoenixManager phoenix;

	public StringHelperExt(ApplicationManager p_manager)
	{
		super(p_manager);
	}

	public String getPriceFromString(String p_string)
	{
		Pattern p = Pattern.compile("[0-9]+.[0-9]+");

		Matcher m = p.matcher(p_string);

		if (m.find())
		{
			return m.group(0);
		}
		else
		{
			phoenix.log().warn("Price in string not found");
			return p_string;
		}
	}
}
